package com.only4play.user.model.entity;

import com.only4play.jpa.support.entity.AggregateEntity;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;

/**
 * @author liyuncong
 * @version 1.0
 * @file UserPersonalAccount.java
 * @brief UserPersonalAccount
 * @details UserPersonalAccount
 * @date 2022-04-01
 *
 * Edit History
 * ----------------------------------------------------------------------------
 * DATE                        NAME               DESCRIPTION
 * 2022-04-01                  liyuncong          Created
 */
@Entity
@Table(name = "user_personal_account")
@Getter
@Setter
public class UserPersonalAccount extends AggregateEntity {
    @Id
    private String id;
    private String username;
    private String password;
    private String alias;
    private String passwordSalt;
    private Integer loginType;
    private Integer isDisable;

    @ManyToOne(fetch = FetchType.EAGER, cascade = {CascadeType.MERGE, CascadeType.PERSIST,
        CascadeType.REFRESH})
    @JoinColumn(name = "user_person_id")
    private UserPerson person;
}
